class Hex:

    def __init__(self):
        self.tile = None
        self.adjacencies = []
        
    def setAdjacencies(self, adjacencies):
        self.adjacencies = adjacencies
        
    def setTile(self, tile):
        self.tile = tile
        
    def getAdjacencies(self):
        return self.adjacencies
        
    def getTile(self):
        return self.tile
    #call for id 1: community park
    # hex.forEachAdjacent([yellow, green, blue], 1, 0)
    #call for id 2: heavy factory
    #hex.forEachAdjacent([grey, green], -1, 0)
    def forEachAdjacent(self, colors, number, type):
        reputation = 0
        for a in self.getAdjacencies():
            for c in colors:
                if a.getColor() == c:
                    reputation = reputation + number
        return reputation
